package com.lhkj.ct.framework.shiro.token;

import com.lhkj.ct.meta.modules.auth.common.enums.IdentType;
import com.lhkj.ct.meta.modules.auth.common.enums.UserType;
import io.swagger.annotations.ApiModelProperty;
import org.apache.shiro.authc.AuthenticationToken;

/**
 * <p>
 *     移动端token
 * </p>
 */
public class AccessTokenAuthenticationToken implements AuthenticationToken{

    @ApiModelProperty(value = "用户类型 1.后台 2.平台用户")
    private UserType userType;

    @ApiModelProperty(value = "第三方唯一标识", notes = "如公众号openId")
    private String identifier;

    @ApiModelProperty(value = "第三方应用类型 1.公众号")
    private IdentType identType;

    public AccessTokenAuthenticationToken(UserType userType, String identifier, IdentType identType) {
        this.userType = userType;
        this.identifier = identifier;
        this.identType = identType;
    }

    public UserType getUserType() {
        return userType;
    }

    public void setUserType(UserType userType) {
        this.userType = userType;
    }

    public String getIdentifier() {
        return identifier;
    }

    public void setIdentifier(String identifier) {
        this.identifier = identifier;
    }

    public IdentType getIdentType() {
        return identType;
    }

    public void setIdentType(IdentType identType) {
        this.identType = identType;
    }

    @Override
    public Object getPrincipal() {
        return identifier;
    }

    @Override
    public Object getCredentials() {
        return null;
    }
}
